package pilhun.collections;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.RandomAccess;

public class listTest {
	public static void main(String[] args) {
//		List list = new LinkedList();
		MyList list = new pilhun.collections.MyArrayList(13);
//		RandomAccess list = new pilhun.collections.MyArrayList(13);
//		MyList list = new pilhun.collections.MyLinkedList();
		//list.add("a");
		//list.add("b");
		//list.add("c");
//		list.addAll(2,Arrays.asList(new String[] {"x", "y"}));
//		list.addAll(2,new String[] {"x", "y"});
		//list.add("d");
//		System.out.println(list.indexOf("z"));
//		list.set(2, "x");
//		list.add("a");
//		list.add("b");
//		list.add("c");
		list.add("b");
		list.add("c");
		list.add("l");
		list.add("a");
		list.add("j");
		list.add("d");
		list.add("f");
		list.add("g");
		list.add("h");
		list.add("k");
		
		list.add("z");
		list.add("y");
		list.add("o");
//		list.addAll(6, new String[] {"xx", "yy", "zz", "abc"});
		System.out.println(list);
//		System.out.println(list.indexOf("a"));
		MyCollections.sort(list);
		System.out.println(list);
//		MyCollections.reverse(list);
		
		System.out.println(MyCollections.binarySearch((RandomAccess)list, "e"));
//		ListIterator liter = list.listIterator(3);
//		liter.next();
//		liter.remove();
//		System.out.println(liter.previous());
//		System.out.println(liter.previous());
//		System.out.println(liter.nextIndex());
//		System.out.println(liter.next());
		System.out.println(list);
		System.out.println(list.size());
//		liter.next();
//		System.out.println(liter.previous());
//		System.out.println(liter.next());
//		liter.next();
//		System.out.println(liter.nextIndex());
//		System.out.println(liter.previousIndex());
//		liter.remove();
//		System.out.println(liter.nextIndex());
//		System.out.println(liter.previousIndex());
//		System.out.println(liter.previous());
//		System.out.println(liter.next());
	}
	
	
}
